<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<System.Collections.Generic.IList<DecisionMaking.Domain.AlgorithmDefinition>>" MasterPageFile="~/Views/Shared/Site.Master" %>
<%@ Import Namespace="MvcContrib.UI.Grid" %>
<asp:Content runat="server" ID="Content" ContentPlaceHolderID="TitleContent">Manage Algorithms</asp:Content>
<asp:Content runat="server" ID="Content2" ContentPlaceHolderID="MainContent">
	<p>
		<%= Html.ActionLink("New Algorithm", "Add") %>
	</p>
	<%
        if (Model.Count > 0)
        {
            Html.Grid(Model).Columns(column =>
            {
                column.For(c => c.Name);
                column.For(c => c.Engine);
                column.For(c => Html.ActionLink("Edit", "Edit", new { id = c.Id })).CellCondition(a => a.Account.Equals(ViewData["currentAccount"])).DoNotEncode();
                column.For(c => Html.ActionLink("Clone", "Clone", new { id = c.Id })).DoNotEncode();
            })
            .Render();
        }
	%>
</asp:Content>
